#include <bits/stdc++.h>
using namespace std;
int n;
int r[1000005];
int r2[1000005];
int ans;

int main()
{
    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);
    scanf("%d", &n);
    ans = n;
    for (int i = 1; i <= n; i++) {
        int a;
        scanf("%d", &a);
        r[a]++;
        r2[a]++;
    }
    int cnt = 1;
    int pos = cnt;
    while (cnt <= 100000) {
        if (!r[cnt]) {
            cnt++;
        } else {
            pos = cnt + 1;
            while (r[cnt] > 0) {
                while (!r2[pos] && pos <= 100000) {
                    pos++;
                }
                if (pos == 100001) {
                    printf("%d", ans);
                    return 0;
                }
                if (r2[pos] >= r[cnt]) {
                    ans -= r[cnt];
                    r2[pos] -= r[cnt];
                    r[cnt] = 0;
                } else {
                    ans -= r2[pos];
                    r[cnt] -= r2[pos];
                    r2[pos] = 0;
                }
            }


        }
    }
    return 0;
}
